//以拓扑图的形式，1->2
//   1->3
function Node(val) {
  this.value = val;
  this.neighbor = []
}

let node1 = new Node(1);
let node2 = new Node(2);
let node3 = new Node(3);
let node4 = new Node(4);

// 此时已存在三个节点，然后需要将其先后关系链接起来

node1.neighbor.push(node2);
node1.neighbor.push(node3);

node2.neighbor.push(node3);
node2.neighbor.push(node1);
node2.neighbor.push(node4);

node3.neighbor.push(node2);
node3.neighbor.push(node1);
node3.neighbor.push(node4);

node4.neighbor.push(node2);
node4.neighbor.push(node3);


console.log(node1, node2, node3, node4);